﻿//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Tests
//  File name:	TestSharePoint.cs
//  Developer:	Solomatov Igor
//  Created:	03.04.2012
// 
//  -------------------- iSharePoint -------------------- //

using System;
using System.Data;
using Microsoft.SharePoint;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Smart.Documents.Tests
{
	[TestClass]
	public class TestSharePoint
	{
		[TestMethod]
		public void LocalSharePointConnection()
		{
			using (var site = new SPSite("http://localhost:777"))
			{
				using (var web = site.OpenWeb())
				{
					Assert.AreNotEqual(Guid.Empty, web.ID);

					var dt =
						web.GetSiteData(new SPSiteDataQuery
											{
												Lists = "<Lists><List ID=\"E6D035EE-DDF2-4010-BE09-49EBBB301BB0\" /></Lists>",
												ViewFields =
													"<FieldRef Name=\"Title\" Type=\"Text\" /><FieldRef Name=\"ContentTypeId\" Type=\"ContentTypeId\" />"
											});

					var dv = new DataView(dt);
				}
			}
		}
	}
}